﻿<ResourceDictionary
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:im="clr-namespace:IdentityMine.Avalon.Controls"

    >
	<Style TargetType="{x:Type im:ChartRotator}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type im:ChartRotator}">
					<Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
						<Viewport3D ClipToBounds="True" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" im:ChartRotator.IsViewport3D="True">
							<Viewport3D.Camera>
								<PerspectiveCamera FarPlaneDistance="20" LookDirection="0,0,-1" UpDirection="0,1,0" NearPlaneDistance="1" Position="0,0,5" FieldOfView="45" />
							</Viewport3D.Camera>
						    <ModelVisual3D>
								
								<!-- Trackball uses this transform -->
								<ModelVisual3D.Transform>
									<Transform3DGroup>
										<Transform3DGroup.Children>
											<Transform3DCollection >

												<ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1" />
												<RotateTransform3D>
													<RotateTransform3D.Rotation>
														<AxisAngleRotation3D Axis="0 1 0" Angle="0" />
													</RotateTransform3D.Rotation>
												</RotateTransform3D>
												<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0" />

											</Transform3DCollection>
										</Transform3DGroup.Children>
									</Transform3DGroup>
								</ModelVisual3D.Transform>
								
								<ModelVisual3D.Content>
									<Model3DGroup>
										<Model3DGroup.Transform>
											<Transform3DGroup>
												<Transform3DGroup.Children>
													<Transform3DCollection>
														<ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
														<RotateTransform3D>
															<RotateTransform3D.Rotation>
																<AxisAngleRotation3D Axis="0,1,0" Angle="0"/>
															</RotateTransform3D.Rotation>
														</RotateTransform3D>
														<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
													</Transform3DCollection>
												</Transform3DGroup.Children>
											</Transform3DGroup>
										</Model3DGroup.Transform>

										<Model3DGroup>
											<Model3DGroup.Transform>
												<Transform3DGroup>
													<Transform3DGroup.Children>
														<Transform3DCollection>
															<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
															<ScaleTransform3D ScaleX="0.739583333333332" ScaleY="0.996683333333333" ScaleZ="1"/>
															<RotateTransform3D CenterX="0" CenterY="0" CenterZ="0">
																<RotateTransform3D.Rotation>
																	<AxisAngleRotation3D Axis="1,0,0" Angle="0"/>
																</RotateTransform3D.Rotation>
															</RotateTransform3D>
															<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
															<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
														</Transform3DCollection>
													</Transform3DGroup.Children>
												</Transform3DGroup>
											</Model3DGroup.Transform>
											
											<AmbientLight Color="#FFFFFFFF"/>
										</Model3DGroup>
									</Model3DGroup>
								</ModelVisual3D.Content>
								
							</ModelVisual3D>
						</Viewport3D>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>
